import 'package:flutter/material.dart';

import '../../config/public_color.dart';
import 'radius_container.dart';

class ShadowContainer extends StatelessWidget {
  final double? radius;

  final double? width;

  final double? height;

  final Color? color;

  final Color? shadowColor;

  final EdgeInsets? padding;

  final EdgeInsets? margin;

  final Alignment? alignment;

  final Decoration? decoration;

  final Widget? child;

  const ShadowContainer({
    super.key,
    this.radius,
    this.width,
    this.height,
    this.color = Colors.white,
    this.shadowColor,
    this.padding,
    this.margin,
    this.alignment,
    this.decoration,
    this.child,
  });

  @override
  Widget build(BuildContext context) {
    if (margin == null) {
      return body();
    }
    return Padding(
      padding: margin ?? EdgeInsets.zero,
      child: body(),
    );
  }

  Widget body() {
    return RadiusContainer(
      radius: 0,
      width: width,
      height: height,
      color: color,
      shadowColor: shadowColor ?? PublicColor.shadow,
      padding: padding,
      margin: margin,
      alignment: alignment,
      decoration: decoration,
      child: child,
    );
  }
}
